package com.yilin.medical.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.yilin.medical.R;
import com.yilin.medical.model.ZhuanJiaDetilsBean;

/**
 * 肿瘤adapter
 * 
 * @author lijianqun
 * 
 */
public class ZhuanJiaDetailsAdapter extends BaseAdapter {
	private List<ZhuanJiaDetilsBean> list = null;
	private Context mContext;

	public ZhuanJiaDetailsAdapter(Context mContext, List<ZhuanJiaDetilsBean> list) {
		this.mContext = mContext;
		this.list = list;
	}

	/**
	 * 当ListView数据发生变化时,调用此方法来更新ListView
	 * 
	 * @param list
	 */
	/*
	 * public void updateListView(List<SortModel> list){ this.list = list;
	 * notifyDataSetChanged(); }
	 */

	public int getCount() {
		return this.list.size();
	}

	public Object getItem(int position) {
		return list.get(position);
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(final int position, View view, ViewGroup arg2) {
		ViewHolder holder = null;
		final ZhuanJiaDetilsBean mContent = list.get(position);
		if (view == null) {
			holder = new ViewHolder();
			view = LayoutInflater.from(mContext).inflate(
					R.layout.listitem_zhuanjiadetails, null);
			holder.tv_title = (TextView) view.findViewById(R.id.title);
			holder.tvLetter = (TextView) view.findViewById(R.id.catalog);
			holder.tv_describe = (TextView) view.findViewById(R.id.tv_describe);
			holder.tv_price = (TextView) view.findViewById(R.id.tv_price);
			holder.tv_share = (TextView) view.findViewById(R.id.tv_share);
			holder.tv_praise = (TextView) view.findViewById(R.id.tv_praise);
			holder.tv_star = (TextView) view.findViewById(R.id.tv_star);
			holder.iv = (ImageView) view.findViewById(R.id.iv);
			view.setTag(holder);
		} else {
			holder = (ViewHolder) view.getTag();
		}


//		holder.tv_title.setText(this.list.get(position).getName());

		return view;

	}

	final static class ViewHolder {
		TextView tvLetter, tv_title, tv_describe, tv_price, tv_share,
				tv_praise, tv_star;
		ImageView iv;
	}

	
}
